<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click="changeState">改变数据</button>
        {{ msg }}
    </div>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                msg:"你好vue"
            },
            methods:{
                changeState(){
                    // console.log(this.msg)
                    this.msg = 'hello vue'
                }
            }
        })
        console.log(vm)
        /*
       var  obj  = {
            name:"小明",
            fn(){
                console.log(this.name)
            },
            c:{
                name:"小花",
                fn(){
                    console.log(this.name)
                }
            }
        }

        obj.fn();
        obj.c.fn();
        obj.c.fn.call(obj);
        */
    </script>
    
</body>
</html>